package com.stee.service.impl;

import java.util.Date;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSON;
import com.stee.eao.UserEAO;
import com.stee.entity.User;
import com.stee.service.UserService;
@Service("userServiceImpl") 
public class UserServiceImpl implements UserService {
	private Logger log = Logger.getLogger(UserServiceImpl.class);
	@Autowired
	private UserEAO eao;
	
	@Transactional
	public String getUserAll() {
		User user = new User();
		user.setAge(22);
		user.setUserCreated("Yingtao2");
		user.setDateCreated(new Date());
		user.setTitle("title2");
		user.setName("name2");
		user.setSid(2);
		eao.save(user); 
		//User u = eao.findBySid(1);
		log.info(JSON.toJSONString(user));
		return JSON.toJSONString(user);
	}

}
